package org.dandsoft.blackbox.mapreduce.client.task;

import org.dandsoft.blackbox.mapreduce.client.operation.Operation;

import java.util.Map;

/**
 * Содержит информацию о том какую операцию запускать, и с какими параметрами
 * так же можно добавить инфомацию для оптимизации
 *
 * @author Vilyuzhanin Denis (Fin)
 */
public class MapReduceInfo extends ActionInfo {

    private Class<? extends Operation> operationClass;
    private Operation operation;
    private Map<String, String> properties;

    public Map<String, String> getProperties() {
        return properties;
    }

    public void setProperties(Map<String, String> properties) {
        this.properties = properties;
    }

    public ActionType getType() {
        return ActionType.MapReduce;
    }

    public Class<? extends Operation> getOperationClass() {
        return operationClass;
    }

    public void setOperationClass(Class<? extends Operation> operationClass) {
        this.operationClass = operationClass;
        this.operation = null;
    }

    public Operation getOperation() {
        return operation;
    }

    public void setOperation(Operation operation) {
        setOperationClass(operation.getClass());
        this.operation = operation;
    }
}
